﻿using System;
using System.Globalization;
using System.Threading;

namespace SpringSeries.Core.StaticMessageSource {
    class Program {
        static void Main(string[] args) {
            string KEY = "HelloMessage";

            Spring.Context.Support.StaticMessageSource _messageSource = new Spring.Context.Support.StaticMessageSource();
            
            CultureInfo _usCulture = new CultureInfo("en-US");

            _messageSource.AddMessage(KEY,Thread.CurrentThread.CurrentUICulture, "Ciao!");

            _messageSource.AddMessage(KEY,_usCulture, "Hi!");
            
            Console.WriteLine("Culture corrente: {0}", System.Threading.Thread.CurrentThread.CurrentUICulture.DisplayName);
            Console.WriteLine("Messaggio con la Culture corrente: {0}", _messageSource.GetMessage(KEY));
            Console.WriteLine("Messaggio con la Culture en-US: {0}", _messageSource.GetMessage(KEY, _usCulture));

            Console.Read();
        }
    }
}
